﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Orchard.ContentManagement.MetaData;
using Newtonsoft.Json;

namespace Piedone.WebServices.Controllers
{
    public class TypesController : Controller
    {
        private readonly IContentDefinitionManager _contentDefinitionManager;

        public TypesController(IContentDefinitionManager contentDefinitionManager)
        {
            _contentDefinitionManager = contentDefinitionManager;
        }

        [ServiceAction]
        public JsonResult Index()
        {
            return Json(_contentDefinitionManager.ListTypeDefinitions(), JsonRequestBehavior.AllowGet);
        }
    }
}
